package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Crowd;
import cn.wolfcode.trip.base.domain.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CrowdMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Crowd record);

    Crowd selectByPrimaryKey(Long id);

    List<Crowd> selectAll();

    int updateByPrimaryKey(Crowd record);

    void inviteCrowd(@Param("crowdId") Long crowdId, @Param("userId") Long userId);

    List<Crowd> selectByUserId(Long userId);

    List<User> selectFriendByCrowdId(Long id);

    Map<String,Object> selectRelation(@Param("crowdId") Long crowdId, @Param("userId") Long userId);

    void deleteCrowdRelationByCrowdAndUser(@Param("crowdId") Long crowdId, @Param("userId") Long userId);
}